//导入 axios
import axios from "@/utils/request.js";

export const users = (params) => axios({
    url: 'users',
    method: 'get',
    params
})

export const editUserState = (uId,type) => axios({
    url: `users/${uId}/state/${type}`,
    method: 'put',
})

export const addUsers = (params) => axios({
    url: 'users',
    method: 'post',
    data: params
})

export const chkUsers = (id) => axios({
    url: `users/${id}`,
    method:'get'
})

export const editUsers = (id,params) =>axios({
    url:`users/${id}`,
    method: 'put',
    data:params
})

export const delUsers = (id) =>axios ({
    url: `users/${id}`,
    method:'delete'
})

export const getAllRole = () => axios({
    url:'roles'
})

export const setUsersRole = (id, params) => axios({
    url: `users/${id}/role`,
    method: 'put',
    data:params
})